home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Snippets / Devices / SCSI Simple Sample / Src / DoGetDriveInfo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-24  |  983 b   |  40 lines  |  [TEXT/KAHL]

  1. /*                                DoGetDriveInfo.c                                */
  2. /*
  3.  * DoGetDriveInfo.c
  4.  * Copyright © 1992-94 Apple Computer Inc. All Rights Reserved.
  5.  */
  6. #include "SCSISimpleSample.h"
  7.  
  8. /*
  9.  * Execute a Bus Inquiry SCSI request on the selected device. If it succeeds,
  10.  * display the results.
  11.  */
  12. void
  13. DoGetDriveInfo(
  14.         DeviceIdent                scsiDevice,                /* -> Bus/target/LUN    */
  15.         Boolean                    noIntroMsg
  16.     )
  17. {
  18.  
  19.         ScsiCmdBlock                scsiCmdBlock;
  20.         SCSI_Inquiry_Data            inquiry;
  21. #define SCB    (scsiCmdBlock)
  22.         
  23.         if (noIntroMsg == FALSE)
  24.             ShowSCSIBusID(scsiDevice, "\pGet Drive Info");
  25.         CLEAR(SCB);
  26.         SCB.scsiDevice = scsiDevice;
  27.         SCB.command.scsi6.opcode = kScsiCmdInquiry;
  28.         SCB.command.scsi6.len = sizeof inquiry;
  29.         SCB.bufferPtr = (Ptr) &inquiry;
  30.         SCB.transferSize = sizeof inquiry;
  31.         SCB.transferQuantum = 1;                        /* Force handshake        */
  32.         /* All other command bytes are zero */
  33.         DoSCSICommandWithSense(&scsiCmdBlock, TRUE, TRUE);
  34.         if (SCB.status == noErr)
  35.             DoShowInquiry(scsiDevice, &inquiry);
  36. #undef SCB
  37. }
  38.  
  39.         
  40.